(function(vc,vm){

    vc.extends({
        data:{
            deleteInvoiceSellerInfo:{

            }
        },
         _initMethod:function(){

         },
         _initEvent:function(){
             vc.on('invoiceSeller','openDelInvoiceSellerModal',function(_params){
                $that.deleteInvoiceSellerInfo = _params;
                $('#delInvoiceSellerModel').modal('show');

            });
        },
        methods:{
            deleteInvoiceSeller:function(){
                vc.http.apiPost(
                    '/invoice.delInvoiceSellerById',
                    JSON.stringify($that.deleteInvoiceSellerInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        let _json = JSON.parse(json);
                        if (_json.code == 0) {
                            //关闭model
                            $('#delInvoiceSellerModel').modal('hide');
                            vc.emit('reloadSellerData', 'list',{});
                            vc.toast('删除销方信息成功');
                        } else {
                            vc.toast(_json.msg);
                        }
                        
                     },
                     function(errInfo,error){
                        console.log('删除销方信息失败:'+errInfo);
                        vc.toast(json);

                     });
            },
            closeDelInvoiceSellerModel:function(){
                $('#delInvoiceSellerModel').modal('hide');
            }
        }
    });

})(window.vc,window.$that);